package com.lizhi.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.lizhi.enums.SubTaskState;
import com.lizhi.enums.TaskTotalState;
import com.lizhi.typehandler.SubTaskExecuteInfoListTypeHandler;
import com.lizhi.typehandler.SubTaskStateListTypeHandler;
import lombok.Data;

import java.util.List;

@Data
@TableName(value = "task", autoResultMap = true)
public class LocalTask {
    @TableId(type = IdType.AUTO)
    private Integer id;

    private String taskType;

    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<String> businessKeys;

    private TaskTotalState taskTotalState;

    @TableField(typeHandler = SubTaskStateListTypeHandler.class)
    private List<SubTaskState> subTaskStates;

    @TableField(typeHandler = SubTaskExecuteInfoListTypeHandler.class)
    private List<SubTaskExecuteInfo> subTaskExecuteInfos;

    private Integer nextSubTaskIndex;
}
